<%@ page language="java" pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>华扬国际管理平台</title>
<link href="/wx-pub/styles/management/themes/css/login.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="/wx-pub/styles/management/javascripts/jquery-1.4.4.min.js"></script>

</head>

<body>
	<c:set var="cfg_use_vdcode" value="Y" />
	<div id="login">
		<div id="login_header">
			<h1 class="login_logo">
				<a href="#"><img src="/wx-pub/styles/management/themes/default/images/login_logo.gif" /></a>
			</h1>
			<div class="login_headerContent">
				<div class="navList">
					<ul>					
					</ul>
				</div>
				<h2 class="login_title"><img src="/wx-pub/styles/management/themes/default/images/login_title.png" /></h2>
			</div>
		</div>
		<div id="login_content">
			<div class="loginForm">
			
		<form method="post" action="<c:url value='/passport/login'/>">
		<input type="hidden" name="backToUrl" value="${param.backToUrl}"/>
		<c:if test="${!empty message}"><p style="color: red">${message}</p></c:if>
		<!-- --> <p>测试用户名:admin 密码:123456</p>
		<p>
			<label>用户名：</label>
			<input type="text" name="username" class="required" size="20"/>
		</p>
		<p>
			<label>密　码：</label>
			<input type="password" name="password" size="20" />
		</p>
		<p><label>&nbsp;</label><input class="sub" type="submit" value="登入"/></p>
	    </form>
			</div>
			<div class="login_banner"><img src="/wx-pub/styles/management/themes/default/images/login_banner.jpg" /></div>
			<div class="login_main">
				<div class="login_inner">
				</div>
			</div>
		</div>
		<div id="login_footer">
			Copyright &copy; 2007-2015 微信公众管理平台.All Rights Reserved
		</div>
	</div>
	
	<script type="text/javascript" language="javascript">


function changeImage() 
{ 
  var time = (new Date()).valueOf();
  document.getElementById("img1").src="validate_code.jsp?time="+time;
}

function checkCode(){
    var msg = '';
	FF = (navigator.userAgent.indexOf("Firefox")!=-1);
	IE = (navigator.userAgent.indexOf("MSIE")!=-1);
  if(IE){
	 //msg += "请使用FireFox浏览器访问!";
  }


    var flag = '${cfg_use_vdcode}';
    
    if(flag == "Y"){
        $("#message").html('验证中...');
    
    var time = (new Date()).valueOf();
    var rcode = $("#rcode").val();
    var joinname = $("#joinname").val();
    var password = $("#password").val();
    

    
    if($.trim(joinname).length==0){
       msg += "请输入用户名!" + "<br/>";
    }
    if($.trim(password).length==0){
       msg += "请输入密码!" + "<br/>";
    }
    if($.trim(rcode).length==0){
       msg += "请输入验证码!";
    }
    
    if($.trim(msg).length > 0){
       $("#message").html(msg);
       return false;
    }
    var url = "checkSessionCode.jsp?rcode=" + rcode + "&time=" + time;
    $.post(url, null, function(json){

         if(json.statusCode == 300){
           $("#message").html(json.message);
           changeImage();
           return false;
         }else if(json.statusCode == 200){
           $("#userloginform").submit();
           return true;
         }

     },"json");
     
     return false;
    }else{
      return true;
    }
  } 

</script>
	
</body>
</html>
